import request from '@/utils/request'

// 查询单位列表
export function listCompany(query) {
  return request({
    url: '/company/company/list',
    method: 'get',
    params: query
  })
}

// 查询单位列表
export function listCompanys(query) {
  return request({
    url: '/company/company/lists',
    method: 'get',
    params: query
  })
}

// 查询本单位及合作单位列表
export function getAllCompanyList(query) {
  return request({
    url: `/company/company/alllist`,
    method: 'get',
    params: query
  })
}

// 查询单位详细
export function getCompany(id) {
  return request({
    url: '/company/company/' + id,
    method: 'get'
  })
}

// 新增单位
export function addCompany(data) {
  return request({
    url: '/company/company',
    method: 'post',
    data: data
  })
}

// 修改单位
export function updateCompany(data) {
  return request({
    url: '/company/company',
    method: 'put',
    data: data
  })
}

// 删除单位
export function delCompany(id) {
  return request({
    url: '/company/company/' + id,
    method: 'delete'
  })
}

// 软删除单位
export function removeCompany(id) {
  return request({
    url: '/company/company/delete',
    method: 'post',
    data: { id }
  })
}


// 单位主页列表
export function companyHomeList(id) {
  return request({
    url: `/company/company/home/${id}`,
    method: 'get'
  })
}

export function companyAddHome(data) {
  return request({
    url: '/company/company/home/add',
    method: 'post',
    data
  })
}
export function companyEditHome(data) {
  return request({
    url: '/company/company/home/edit',
    method: 'post',
    data
  })
}
export function companyDeleteHome(id) {
  return request({
    url: `/company/company/home/delete/${id}`,
    method: 'get'
  })
}
export function companyDetailHome(id) {
  return request({
    url: `/company/company/home/detail/${id}`,
    method: 'get'
  })
}

// 移动端菜单
export function appmenuBaseList() {
  return request({
    url: `/system/appmenu/baseList`,
    method: 'get'
  })
}
// 单位申请进驻平台
export function companyApply(id) {
  return request({
    url: `/company/company/apply?id=${id}`,
    method: 'post'
  })
}
// 单位入驻审核列表
export function companyAplist(data) {
  return request({
    url: `/company/company/aplist`,
    method: 'get',
    params: data
  })
}
// 单位入驻审核
export function companyAp(data) {
  return request({
    url: `/company/company/ap`,
    method: 'post',
    data
  })
}

// 单位入驻审批流程
export function aplogList(data) {
  return request({
    url: `/system/aplog/list`,
    method: 'get',
    params: data
  })
}

// 单位批量设置
export function batchSetCompany(data) {
  return request({
    url: `/company/company/batch/company/set`,
    method: 'post',
    data
  })
}

// 单位资质审核列表
export function companyVerifyList(data) {
  return request({
    url: `/company/verify/list`,
    method: 'get',
    params: data
  })
}

// 单位资质审核详情
export function companyVerifyDetail(id) {
  return request({
    url: `/company/verify/detail?id=${id}`,
    method: 'get'
  })
}

// 单位资质审核
export function companyVerifyOperate(data) {
  return request({
    url: `/company/verify/operate`,
    method: 'post',
    data
  })
}

// 单位资质审核后快速配置
export function companyConfiguration(data) {
  return request({
    url: `/company/verify/quick/set`,
    method: 'post',
    data
  })
}
